# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=reaver-wps-fork-t6x
pkgver=1.6.6
pkgrel=1
pkgdesc="Community forked version of reaver, the WPS password cracker"
url="https://github.com/t6x/reaver-wps-fork-t6x"
arch="all !s390x" # aircrack-ng disabled for s390x
license="GPL-2.0-only"
options="!check" #upstream does not provide check
depends="aircrack-ng pixiewps sqlite"
makedepends="libpcap-dev linux-headers sqlite-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/t6x/$pkgname/archive/v$pkgver.tar.gz
reassociate-fix-bug.patch"

build() {
	cd "$builddir"/src
	./configure \
		--prefix=/usr \
		--bindir=/usr/bin \
		--sbindir=/usr/sbin \
		--localstatedir=/var \
		--sysconfdir=/etc
	make
}

package() {
	cd "$builddir"/src
	mkdir -p "$pkgdir"/etc/reaver
	make DESTDIR="$pkgdir" install
	chmod 750 "$pkgdir"/etc/reaver
}

sha512sums="431e3ed03eb6145a33a27bd03f4568c58046721566505f06bb0fe42ace8327d6749a70d443a592278253248f676299ff29962c839409d0173733eaaf0e2e6410  reaver-wps-fork-t6x-1.6.6.tar.gz
3458aed74063d6c268e9ddb154bc2a3d357de62856416ce817d2446563336002a84dc0bde146d98c545eadd718f8aec994d5756b09b847e37d80590b747a31f9  reassociate-fix-bug.patch"
